<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
    public $components = array('DebugKit.Toolbar','Session','Cookie','Auth');
    public function beforeFilter() {
        if($tmp = $this->Cookie->read('Lang')){
            $this->Session->write('Config.language',$tmp);
            Configure::write('Config.language',$tmp);
        }else{
            $this->Session->write('Config.language','english');
            Configure::write('Config.language','english');
        }
    }
}
